@extends('layouts.template')

@section('title', '管理后台')

@section('content')

    <script>
        $(function(){

            var form = new Vue({
                el:'#contentpanel',
                data:{
                },
                computed:{
                },
                mounted:function(){
                },
                watch: {
                },
                methods:{
                },
                components:{
                }
            });

        });

    </script>

    <div class="panel-body">
        <div class="panel panel-default">
            <div class="panel-body">
                <form action="" method="GET" class="form-inline">
                    <div>
                        {!! $filter !!}
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="contentpanel" id="contentpanel">

        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table mb30">
                        <thead>
                        <tr style="white-space:nowrap">
                            <th><input type="checkbox" onclick="checkall(this)">选择</th>
                            <th>订单编号</th>
                            <th>下单时间</th>
                            <th>下单用户</th>
                            <th>省市区</th>
                            <th>订单地址</th>
                            <th>服务类型</th>
                            <th>订单状态</th>
                            <th>订单异常状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($list as $row):?>
                            <tr data-id="{{$row->id}}">
                                <td><input type="checkbox" value="{{$row->id}}" name="user[]"></td>
                                <td>{{$row->order_number}}</td>
                                <td>{{$row->add_time}}</td>
                                <td>{{$row->merchant ? $row->merchant->me_username : ''}}</td>
                                <td>{{$row->detail->customer_area_text}}</td>
                                <td>{{$row->detail->customer_address}}</td>
                                <td>{{$row->service_type_text}}</td>
                                <td>{{$row->status->merchant_status_text}}
                                    @if ($row->status->success)
                                        /{{$row->status->evaluate_status_text}}
                                    @endif
                                </td>
                                <td>
                                    @if ($row->status->except_statu)
                                        {{$row->status->except_status_text}}
                                    @elseif ($row->status->have_arbitrate)
                                        {{$row->status->arbitrate_status_text}}
                                    @elseif ($row->status->have_refund)
                                        {{$row->status->refund_status_text}}
                                    @else
                                        无异常
                                    @endif

                                    @if ($row->status->refunded || $row->status->arbitrated)
                                        /交易关闭
                                    @endif
                                </td>
                                <td>
                                    <a href="{{url("order/show/{$row->id}")}}" class="btn btn-white">查看详情</a>
                                </td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                </div>
                <!-- table-responsive -->
                {{ @!$list->isEmpty() ? $list->appends(request()->all())->links() : '' }}
            </div>
            <!-- col-md-12 -->
        </div>
    </div><!-- contentpanel -->


@endsection

